07. Freezing Weights & Last Layer

Freezing Weights

Freezing parameters

To freeze any parameters, you can use the variable requires_grad. By default this is set to True. To freeze existing parameters you can loop through each one and set param.requires_grad = False.

Above, there is a small typo, which leaves out the s in requires_grad. This has been fixed in the exercise notebooks and our Github repo.